package com.zcmyth;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

import com.google.common.collect.ImmutableList;

public class MergeSortTest {

  @Test
  public void empty() {
    assertEquals(MergeSort.sort(ImmutableList.<Integer> of()), ImmutableList.<Integer> of());
  }

  @Test
  public void one() {
    assertEquals(MergeSort.sort(ImmutableList.of(1)), ImmutableList.of(1));
  }

  @Test
  public void more() {
    assertEquals(MergeSort.sort(ImmutableList.of(1, 3, 3, 1, 2, 4)),
        ImmutableList.of(1, 1, 2, 3, 3, 4));
  }

  @Test
  public void reverce() {
    assertEquals(MergeSort.sort(ImmutableList.of(5, 4, 3, 2, 1)), ImmutableList.of(1, 2, 3, 4, 5));
  }
}
